package co.yixiang.modules.order.vo;

import co.yixiang.modules.order.service.dto.ProductDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 订单商品对象
 * </p>
 *
 * @author hupeng
 * @date 2019-11-03
 */
@Data
public class OrderCartInfoVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    private String orderId;

    @ApiModelProperty(value = "商品ID")
    private Long productId;

    @ApiModelProperty(value = "购物车数量")
    private Integer cartNum;

    @ApiModelProperty(value = "拼团产品ID")
    private Long combinationId;

    @ApiModelProperty(value = "秒杀产品ID")
    private Long seckillId;

    @ApiModelProperty(value = "砍价产品ID")
    private Long bargainId;

    @ApiModelProperty(value = "产品信息")
    private ProductDto productInfo;

    OrderCartInfoVo(String orderId, Long productId, Integer cartNum, Long combinationId, Long seckillId, Long bargainId, ProductDto productInfo) {
        this.orderId = orderId;
        this.productId = productId;
        this.cartNum = cartNum;
        this.combinationId = combinationId;
        this.seckillId = seckillId;
        this.bargainId = bargainId;
        this.productInfo = productInfo;
    }

    public static OrderCartInfoVoBuilder builder() {
        return new OrderCartInfoVoBuilder();
    }


    public static class OrderCartInfoVoBuilder {
        private String orderId;
        private Long productId;
        private Integer cartNum;
        private Long combinationId;
        private Long seckillId;
        private Long bargainId;
        private ProductDto productInfo;

        OrderCartInfoVoBuilder() {
        }

        public OrderCartInfoVoBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public OrderCartInfoVoBuilder productId(Long productId) {
            this.productId = productId;
            return this;
        }

        public OrderCartInfoVoBuilder cartNum(Integer cartNum) {
            this.cartNum = cartNum;
            return this;
        }

        public OrderCartInfoVoBuilder combinationId(Long combinationId) {
            this.combinationId = combinationId;
            return this;
        }

        public OrderCartInfoVoBuilder seckillId(Long seckillId) {
            this.seckillId = seckillId;
            return this;
        }

        public OrderCartInfoVoBuilder bargainId(Long bargainId) {
            this.bargainId = bargainId;
            return this;
        }

        public OrderCartInfoVoBuilder productInfo(ProductDto productInfo) {
            this.productInfo = productInfo;
            return this;
        }

        public OrderCartInfoVo build() {
            return new OrderCartInfoVo(orderId, productId, cartNum, combinationId, seckillId, bargainId, productInfo);
        }

        public String toString() {
            return "OrderCartInfoVo.OrderCartInfoVoBuilder(orderId=" + this.orderId + ", productId=" + this.productId + ", cartNum=" + this.cartNum + ", combinationId=" + this.combinationId + ", seckillId=" + this.seckillId + ", bargainId=" + this.bargainId + ", productInfo=" + this.productInfo + ")";
        }
    }
}
